Exemplo n.º 1
0
e),require("x.hub.m.gateway.js").updateGatewayNeoIndex());b()}],function(b){g&&g(b)})};c.prototype._writeZip=function(a,d){var f=require("os"),e=require("fs"),g=require("path"),h="nam_"+Math.round((new Date).getTime()/1E3)+".zip",b=g.join(f.tmpdir(),h);this._logger.log("trace","create temp deploy zip:"+b);f=e.createWriteStream(b);a.pipe(f);var c=d;f.on("error",function(b){c&&c(b);c=null});f.on("close",function(){c&&c(null,b);c=null})};c.prototype._unzip=function(a,d){var f=require("adm-zip"),e=require("x.hub.fileman.js").fileManager.getUserRootDataPath();
Exemplo n.º 2
0
this._encryptDeviceDBFileSync(d);a&&a()};c.prototype._encryptDeviceDBFileSync=function(a){var d=require("fs"),f=require("x.crypt"),e=require("m.aio.devicemanager");try{if(d.existsSync(a)){this._logger.log("trace","[_encryptDeviceDB] Encrypting "+a);var g=d.readFileSync(a,"utf8");g&&(g=f.AES.encodeString(g,e.ml_v1_info()),d.writeFileSync(a+".enc",g),d.unlinkSync(a))}}catch(h){console.error(h),this._logger.log("error","[_encryptDeviceDB] "+h.message)}};c.prototype.deploy2=function(a,d,f,e,g){var h=