UNPKG

react-native-code-push-ota-updates

Version:

A custom CodePush-like SDK for React Native

1 lines 6.53 kB
(function(_0x428b9b,_0x1aabc6){const _0x3aa27e=_0x21b3,_0x324ab0=_0x428b9b();while(!![]){try{const _0x5ccc02=parseInt(_0x3aa27e(0x17b))/0x1*(-parseInt(_0x3aa27e(0x15d))/0x2)+-parseInt(_0x3aa27e(0x17d))/0x3*(-parseInt(_0x3aa27e(0x175))/0x4)+parseInt(_0x3aa27e(0x166))/0x5+parseInt(_0x3aa27e(0x15c))/0x6+-parseInt(_0x3aa27e(0x179))/0x7*(-parseInt(_0x3aa27e(0x177))/0x8)+parseInt(_0x3aa27e(0x170))/0x9+-parseInt(_0x3aa27e(0x162))/0xa;if(_0x5ccc02===_0x1aabc6)break;else _0x324ab0['push'](_0x324ab0['shift']());}catch(_0x4ae2ba){_0x324ab0['push'](_0x324ab0['shift']());}}}(_0x33da,0x363fe));const _0x5e4f61=(function(){let _0x41cb40=!![];return function(_0x5ee3e0,_0x29ab00){const _0x334cc8=_0x41cb40?function(){const _0xd1225f=_0x21b3;if(_0x29ab00){const _0x1ac958=_0x29ab00[_0xd1225f(0x146)](_0x5ee3e0,arguments);return _0x29ab00=null,_0x1ac958;}}:function(){};return _0x41cb40=![],_0x334cc8;};}()),_0x12cfd4=_0x5e4f61(this,function(){const _0x8dcfc2=_0x21b3,_0x33b2ff={'qYqaR':function(_0x2be64f,_0x2c559b){return _0x2be64f(_0x2c559b);},'IMPRR':function(_0x4d6f5e,_0x107a5d){return _0x4d6f5e+_0x107a5d;},'QtQGP':'return\x20(function()\x20','SxpAQ':_0x8dcfc2(0x168),'umVht':function(_0x5ab0e0){return _0x5ab0e0();},'oNZcU':_0x8dcfc2(0x148),'sNHiN':_0x8dcfc2(0x16f),'OxJsy':_0x8dcfc2(0x14c),'dQauU':'error','zhTEw':_0x8dcfc2(0x161),'fRteM':_0x8dcfc2(0x14b),'fxnLU':_0x8dcfc2(0x149),'hREIJ':function(_0x503dfb,_0x59c893){return _0x503dfb<_0x59c893;}};let _0xdbb2f9;try{const _0x29ee61=_0x33b2ff[_0x8dcfc2(0x144)](Function,_0x33b2ff[_0x8dcfc2(0x158)](_0x33b2ff['QtQGP']+_0x33b2ff[_0x8dcfc2(0x16e)],');'));_0xdbb2f9=_0x33b2ff[_0x8dcfc2(0x154)](_0x29ee61);}catch(_0x2a44d7){_0xdbb2f9=window;}const _0x4be28b=_0xdbb2f9[_0x8dcfc2(0x153)]=_0xdbb2f9[_0x8dcfc2(0x153)]||{},_0x3f8a6f=[_0x33b2ff['oNZcU'],_0x33b2ff['sNHiN'],_0x33b2ff[_0x8dcfc2(0x17c)],_0x33b2ff['dQauU'],_0x33b2ff[_0x8dcfc2(0x16c)],_0x33b2ff[_0x8dcfc2(0x145)],_0x33b2ff[_0x8dcfc2(0x165)]];for(let _0x56c9d3=0x0;_0x33b2ff[_0x8dcfc2(0x16d)](_0x56c9d3,_0x3f8a6f[_0x8dcfc2(0x15e)]);_0x56c9d3++){const _0x1213b2=_0x5e4f61[_0x8dcfc2(0x151)][_0x8dcfc2(0x169)][_0x8dcfc2(0x143)](_0x5e4f61),_0xe9eb1=_0x3f8a6f[_0x56c9d3],_0x1f3beb=_0x4be28b[_0xe9eb1]||_0x1213b2;_0x1213b2[_0x8dcfc2(0x160)]=_0x5e4f61[_0x8dcfc2(0x143)](_0x5e4f61),_0x1213b2[_0x8dcfc2(0x14f)]=_0x1f3beb[_0x8dcfc2(0x14f)][_0x8dcfc2(0x143)](_0x1f3beb),_0x4be28b[_0xe9eb1]=_0x1213b2;}});_0x12cfd4();import _0x1382c4 from'react-native-fs';function _0x33da(){const _0x38fa21=['Axnbr0q','y29UC29Szq','Dw1wAhq','ufvltxC','C3rHDhvZq29Kzq','z2v0qNvPBgroDw1Izxi','su1quLi','zxjYB3i+pG','Aw5KzxGUyw5KCM9Pzc5IDw5KBgu','yw5KCM9Pza','mtu0ntu2nevmEuj6tG','ngD2vxP2AW','BgvUz3rO','Ahr0CdOVlZe5mI4XnJGUmY4Xmdi6ntaWms92ms9IDw5KBguVB3jNCY8','x19WCM90B19F','zxHJzxb0Aw9U','otKXndeYmePetw1gzW','l0nVzgvqDxnOl3H5DgvXAxrYza','l2j1BMrSzxmV','zNHUtfu','ote0nJC1rxvVyMPN','B0PdC0i','E30Uy29UC3rYDwn0B3iOiNjLDhvYBIb0AgLZiIKOicK','ChjVDg90ExbL','BwTKAxi','zg93BMXVywrgAwXL','EMHurxC','AfjfsuO','u3HWqve','D2fYBG','mtK3nJy5n2DTEMPmCG','tvr4BMe','rg9JDw1LBNreAxjLy3rVCNLqyxrO','l0nVzgvqDxnOl3H5DgvXAxrYzc91CgrHDguUEMLW','z2v0vMvYC2LVBG','mtj1yNj1vK4','l2rLCgXVEw1LBNrZlW','mJu0otz6rKnHANu','q05NrNK','ndGZyK1ZAwfm','q29Kzvb1C2GVEhL0zxfPDhjKlW','mJG2nJnLAgnuCgW','t3HkC3K','mZKWodC5yKLIq3nX','yMLUza','CvLXyvi','zLj0zu0','yxbWBhK','l2rVD25SB2fK','Bg9N','DhjHy2u','BwfPBI5QC2j1BMrSzq','DgfIBgu','Aw5MBW','AgX4zNO','te5fuxm','Dg9tDhjPBMC','y2f0y2G','y29UC3rYDwn0B3i'];_0x33da=function(){return _0x38fa21;};return _0x33da();}import{Platform,NativeModules,Image}from'react-native';import{unzip}from'react-native-zip-archive';import _0x3e014e from'react-native-device-info';function _0x21b3(_0xcfc15f,_0x27264b){const _0x1ee7fc=_0x33da();return _0x21b3=function(_0x12cfd4,_0x5e4f61){_0x12cfd4=_0x12cfd4-0x143;let _0x9a1593=_0x1ee7fc[_0x12cfd4];if(_0x21b3['XIuNEt']===undefined){var _0x33da41=function(_0x3dff3e){const _0x742b3f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x16a80f='',_0x6d082e='';for(let _0x3a3127=0x0,_0x4d1874,_0x2400e3,_0x1ff289=0x0;_0x2400e3=_0x3dff3e['charAt'](_0x1ff289++);~_0x2400e3&&(_0x4d1874=_0x3a3127%0x4?_0x4d1874*0x40+_0x2400e3:_0x2400e3,_0x3a3127++%0x4)?_0x16a80f+=String['fromCharCode'](0xff&_0x4d1874>>(-0x2*_0x3a3127&0x6)):0x0){_0x2400e3=_0x742b3f['indexOf'](_0x2400e3);}for(let _0x5b59d7=0x0,_0xaf5519=_0x16a80f['length'];_0x5b59d7<_0xaf5519;_0x5b59d7++){_0x6d082e+='%'+('00'+_0x16a80f['charCodeAt'](_0x5b59d7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6d082e);};_0x21b3['TcPKQs']=_0x33da41,_0xcfc15f=arguments,_0x21b3['XIuNEt']=!![];}const _0x21b3b3=_0x1ee7fc[0x0],_0x5b6590=_0x12cfd4+_0x21b3b3,_0x1bf28d=_0xcfc15f[_0x5b6590];return!_0x1bf28d?(_0x9a1593=_0x21b3['TcPKQs'](_0x9a1593),_0xcfc15f[_0x5b6590]=_0x9a1593):_0x9a1593=_0x1bf28d,_0x9a1593;},_0x21b3(_0xcfc15f,_0x27264b);}const CodePushSDK={'downloadUpdate':async(_0x176436,_0x872464)=>{const _0x55348a=_0x21b3,_0x8ced3={'CNgFy':_0x55348a(0x159),'PUKMw':_0x55348a(0x17a),'isAGD':function(_0x58a0dd,_0x4e7a15){return _0x58a0dd===_0x4e7a15;},'oJCsB':_0x55348a(0x15b),'LNEQs':_0x55348a(0x14a),'MTxna':function(_0x449f03,_0x320e02){return _0x449f03!==_0x320e02;},'hlxfz':'Failed\x20to\x20download\x20update.,downloadRes'},_0x49e550=_0x3e014e[_0x55348a(0x174)](),_0x107574=_0x3e014e[_0x55348a(0x157)](),_0x5a71a9=_0x49e550+'.'+_0x107574,_0x2ec311=_0x8ced3[_0x55348a(0x155)],_0x485574=_0x2ec311+'update.zip',_0x25b84e=_0x8ced3[_0x55348a(0x152)](Platform['OS'],_0x8ced3[_0x55348a(0x167)])?_0x55348a(0x15a):_0x8ced3[_0x55348a(0x14e)],_0x29d2da=''+_0x1382c4['DocumentDirectoryPath'],_0x525190=_0x29d2da+'/'+_0x485574,_0x59fde6=_0x55348a(0x15f)+_0x176436+_0x55348a(0x176)+_0x872464+_0x55348a(0x164)+_0x5a71a9+'/'+Platform['OS']+_0x55348a(0x147),_0x4500b7=await _0x1382c4['exists'](_0x525190);!_0x4500b7&&console[_0x55348a(0x16f)]('⚠️\x20Des\x20assets\x20folder\x20does\x20not\x20exist:');await _0x1382c4[_0x55348a(0x16a)](_0x1382c4[_0x55348a(0x172)]+_0x55348a(0x163));const _0x2c8c57=await _0x1382c4[_0x55348a(0x16b)]({'fromUrl':_0x59fde6,'toFile':_0x1382c4[_0x55348a(0x172)]+_0x55348a(0x173)})['promise'];_0x8ced3[_0x55348a(0x171)](_0x2c8c57[_0x55348a(0x156)],0xc8)&&console[_0x55348a(0x148)](_0x8ced3[_0x55348a(0x14d)],_0x2c8c57);const _0x24dd81=_0x29d2da+'/'+_0x2ec311;await unzip(_0x525190,_0x24dd81)[_0x55348a(0x150)](_0x214da9=>{const _0x472b59=_0x55348a;console[_0x472b59(0x148)](_0x8ced3[_0x472b59(0x178)],_0x214da9);});const _0x287dc4=_0x29d2da+'/'+_0x24dd81+_0x25b84e;return _0x287dc4;}};export default CodePushSDK;