From 4df254ea880e0023eb3c5463a1a8af850670754a Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 19 Apr 2023 12:40:58 +0000 Subject: [PATCH] wait #5869 @1.5 --- .../class.ws.packager.mac.exe.html.php | 66 +++++-------------- .../class.ws.packager.win.exe.html.php | 1 - 2 files changed, 15 insertions(+), 52 deletions(-) diff --git a/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php b/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php index 3020d1c9c..bfd891219 100644 --- a/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php +++ b/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php @@ -21,13 +21,8 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML $p = $this->getFinalPackageDir() . '/' . $item; `rm -rf "$p"`; } - if ($zip) { - $res = $this->zip(null); - } else { - $res = $this->getFinalPackageDir(); - } $this->postPackage(); - return $res; + return $this->getURLBase('zip'); } public function getAppPath() @@ -35,12 +30,6 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML return $this->getFinalPackageDir() . '/' . $this->exeName . '.app'; } - public function getFinalPackageDir() - { - $res = parent::getFinalPackageDir(); - return $res; - } - protected function preparePackage() { $this->initTempDir(); @@ -77,51 +66,26 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML copy(WS_COMPILE_ASSETS . '/_exehtml/_ffmpeg/libffmpeg.dylib', $this->getAppPath() . '/Contents/Frameworks/nwjs Framework.framework/Versions/Current/libffmpeg.dylib'); } - protected function signApp() - { - self::_signApp($this->getAppPath()); - } - public static function _signApp($appPath, $back = true) + public function signApp() { - $local_root = '/Users/vincent/Sign/'; - $dist_root = '/mnt/sshfs/macparis' . $local_root; - - $f = 'tmp_' . md5(rand(0, 1000000)) . ".app"; - $path = $dist_root . $f; + $remote_root = '/Users/macossign/Documents/Sign/'; + $appPath = $this->getAppPath(); + CubeIT_Util_Zip::archive($appPath . '/..', $appPath . ".zip", 1); + $remoteSigned = $remote_root . $this->exeName . '.app.zip'; - // Copy app to mac - $cp = new CubeIT_CommandLine('cp'); - $cp->setArg('r'); - $cp->setArg(null, $appPath); - $cp->setArg(null, $path); - $cp->execute(); - $cp->debug(); + $ssh = new CubeIT_Networking_SSH2('paris.cubedesigners.com', 'macossign', 'rntj55bw', 22622); + $ssh->send($appPath . ".zip", $remoteSigned); // Sign app - $cl = new CubeIT_CommandLine($local_root . 'sign'); - $cl->setSSH(wsExporter::VINCENT, 'vincent', 'atacama', 22022); - $cl->setArg(null, $local_root . $f); - $cl->execute(); + $cl = new CubeIT_CommandLine($remote_root . 'sign3'); + $cl->setArg(null, $this->exeName); + $cl->execute($ssh); $cl->debug(); - $res = $cl->output; - - if ($back) { - // Copy back signed - $cp = new CubeIT_CommandLine('rsync'); - $cp->setArg('r'); - $cp->setArg('l'); - $cp->setArg('p'); - $cp->setArg('D'); - $cp->setArg('v'); - $cp->setArg(null, $path . '/'); - $cp->setArg(null, $appPath . '/'); - $cp->setArg('delete'); - $cp->execute(); - $cp->debug(); - } - // `rm -rf $path`; - return $res; + $finalPath = $this->getPathBase('zip'); + + $ssh->recv($remoteSigned, $finalPath); + $ssh->unlink($remoteSigned); } } diff --git a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php index bce65171f..5b21b18b8 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php +++ b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php @@ -77,7 +77,6 @@ class wsPackagerWinEXEHTML extends wsPackager } $this->replaceFFMpeg(); - $this->signExe(); } -- 2.39.5