var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.taskRnvCryptoInstallCerts=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _logger=require("../core/systemManager/logger");




var _fileutils=require("../core/systemManager/fileutils");


var _exec=require("../core/systemManager/exec");
var _engineManager=require("../core/engineManager");
var _constants=require("../core/constants");


var taskRnvCryptoInstallCerts=function taskRnvCryptoInstallCerts(c,parentTask,originTask){var kChain,list,cerArr;return _regenerator.default.async(function taskRnvCryptoInstallCerts$(_context){while(1){switch(_context.prev=_context.next){case 0:
(0,_logger.logTask)('taskRnvCryptoInstallCerts');_context.next=3;return _regenerator.default.awrap(

(0,_engineManager.executeTask)(c,_constants.TASK_PROJECT_CONFIGURE,_constants.TASK_CRYPTO_INSTALL_CERTS,originTask));case 3:if(!(

c.platform!=='ios')){_context.next=6;break;}
(0,_logger.logError)("_installTempCerts: platform "+c.platform+" not supported");return _context.abrupt("return",
true);case 6:

kChain=c.program.keychain||'ios-build.keychain';

list=(0,_fileutils.getFileListSync)(c.paths.workspace.project.dir);
cerArr=list.filter(function(v){return v.endsWith('.cer');});_context.prev=9;


Promise.all(
cerArr.map(function(v){return(0,_exec.executeAsync)(c,"security import "+v+" -k "+kChain+" -A");}));_context.next=17;break;case 13:_context.prev=13;_context.t0=_context["catch"](9);


(0,_logger.logWarning)(_context.t0);return _context.abrupt("return",
true);case 17:case"end":return _context.stop();}}},null,null,[[9,13]],Promise);};exports.taskRnvCryptoInstallCerts=taskRnvCryptoInstallCerts;var _default=



{
description:'',
fn:taskRnvCryptoInstallCerts,
task:_constants.TASK_CRYPTO_INSTALL_CERTS,
params:_constants.PARAMS.withBase(),
platforms:[],
skipPlatforms:true};exports.default=_default;
//# sourceMappingURL=task.rnv.crypto.installCerts.js.map