m.aio.syncmanager.RemoteDownloader.prototype._decrypt=function(d,b){try{return require("x.crypt.js").AES.decodeString(d,b).trim()}catch(c){return console.log(c),null}};m.aio.syncmanager.RemoteDownloader.prototype._decryptFile=function(d,b){var c=this,a=require("fs"),e=d+".bak";a.rename(d,e,function(f){f?b&&b(f):a.readFile(e,{encoding:"utf8"},function(f,h){f?b&&b(f):(f=c._decrypt(h,c._remotePassword))?a.writeFile(d,f,function(c){c?b&&b(c):a.unlink(e,function(a){b&&b(a)})}):b&&b(Error("decrypt error"))})})};
new m.aio.devicemanager.IntHandler(e,a,{devices:[],rooms:[],gateways:[]});this.handlers.push(h);a=g+f.sep+m.aio.devicemanager.DeviceManager.DB;var k=g+f.sep+m.aio.devicemanager.DeviceManager.DEVICE_INFO,l=require("fs-extra"),n=!1;l.existsSync(a+".enc")&&(a+=".enc",n=!0);var p=function(){d(h,k,function(){c&&c()})};(function(a,b,c){var d=require("fs");d.exists(b,function(f){f?d.readFile(b,{encoding:"utf8"},function(d,f){if(!d&&0<f.length)try{String(b).endsWith(".enc")&&(f=require("x.crypt").AES.decodeString(f,
e.ml_v1_info()));var g=JSON.parse(f);g&&(a.data=g,a.data.devices||(a.data.devices=[]),a._sort(a.data.devices),a.data.gateways||(a.data.gateways=[]),a._sort(a.data.gateways),a.data.rooms||(a.data.rooms=[]),a._sort(a.data.rooms))}catch(r){console.error(r)}c()}):d.writeFile(b,"",function(){c()})})})(h,a,function(){n?p():h._save(function(){var a=f.join(g,"cloud"),b=f.join(g,"automation"),c=f.join(g,"remotes");if(l.existsSync(a))try{l.remove(a)}catch(q){console.error(q)}if(l.existsSync(b))try{var d=l.readdirSync(b);