argument('type'); $types = [ ClientIOSType::BUYER, ClientIOSType::SELLER]; if (!in_array($clientType, $types)) { dump('type error:' . $clientType); return; } $outIpaPemPath = base_path('scripts/sign/ipas/'.date('Ymd')); if (!file_exists($outIpaPemPath)) { mkdir($outIpaPemPath,0777, true); } if ($clientType == ClientIOSType::BUYER) { $version = Apps::buyerIOSVersion(); } else if ($clientType == ClientIOSType::SELLER) { $version = Apps::sellerIOSVersion(); } $uuid = 'a018277820e5eb371a8ffc5587afb3896410f40b'; $udidType = sprintf('release-%s-%s', $clientType, $version); $provPath = $outIpaPemPath . '/'. $udidType . '.prov'; $certfPath = $outIpaPemPath . '/'. $udidType . '.certf'; if ($clientType == ClientIOSType::BUYER) { $realIpaPath = Helps::ipaBuyerPath(); $appBundleId = 'com.pingco.daxiangzj'; } else { $realIpaPath = Helps::ipaSellerPath(); $appBundleId = 'com.pingco.yunduoxd'; } $shellPath = base_path('scripts/sign'); putenv('LANG=en_US.UTF-8'); $shell = "$shellPath/run.sh $appBundleId hanbin@pingco.com Zhang121748 2R4737WLD7 $uuid $shellPath/CertificateSigningRequest.certSigningRequest $provPath $certfPath"; exec($shell,$output, $outcode); if ($outcode != 0) { dump('生成profile文件失败', [ 'code' => $outcode, 'error' => $output, 'shell' => $shell, ]); return; } $shellOutIpaPath = $outIpaPemPath . '/' . $udidType. '.ipa'; $shellIpa = "/usr/bin/zsign -k $shellPath/kefen.pem -p yunduoxd -m $provPath -o $shellOutIpaPath -z 9 $realIpaPath 2>&1"; exec($shellIpa,$outputIpa, $outCodeIpa); if ($outCodeIpa != 0) { dump('签名ipa文件失败', [ 'code' => $outCodeIpa, 'error' => $outputIpa, 'shell' => $shellIpa, ]); return; } $shellMv = "mv -f $shellOutIpaPath $realIpaPath"; exec($shellMv,$outputMv, $outCodeMv); if ($outCodeMv != 0) { Log::error('签名ipa文件失败', [ 'code' => $outCodeMv, 'error' => $outputMv, 'shell' => $shellMv, ]); return; } dump('IosIpaSign:: ipa build succeess~~~~~~~~~~~'); } }