From 1a54466e600f83c6380265c688ad9ff31f323e3d Mon Sep 17 00:00:00 2001 From: Leow Date: Mon, 23 Apr 2018 09:33:29 +0900 Subject: [PATCH] Fixed ios save images crash --- molpay.js | 2 +- package.json | 2 +- plugin.xml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/molpay.js b/molpay.js index f260263..9ea120a 100644 --- a/molpay.js +++ b/molpay.js @@ -1 +1 @@ -var _0x818b=['toast','showWithOptions','bottom','requestPermission','WRITE_EXTERNAL_STORAGE','hasPermission','indexOf','replace','atob','innerHTML','base64ImageUrlData','filename','saveBase64Image','cordova/exec','startMolpay','module_id','wrapper_version','getElementById','molpay','padding','border','createElement','iframe','updateSdkData','load','mainUiFrame','allowScriptAccess','always','setAttribute','src','transactionRequest','body','closeMolpay','closemolpay','testMerchantCredentials','appendChild','testMerchantChannels','exports','open','InAppBrowser','prototype','remove','removeChild','length','parentElement','molpay-mobile-xdk-cordova','mptransactionresults://','mprunscriptonpopup://','mpcloseallwindows://','mppinstructioncapture://','MOLPay/result.php','MOLPay/nbepay.php','\x22msgType\x22:\x22B4\x22','\x22msgType\x22:\x22C6\x22','style','visibility','hidden','position','absolute','width','0px','height','visible','100%','=0x0;_0xa1aca4--)this[_0xa1aca4]&&this[_0xa1aca4][_0xb818('0x6')]&&this[_0xa1aca4][_0xb818('0x6')][_0xb818('0x4')](this[_0xa1aca4]);};var isInternalDebugging=!0x1,moduleId=_0xb818('0x7'),wrapperVersion='2',molpaySdkUrl='molpay-mobile-xdk-www/index.html',mpopenmolpaywindow='mpopenmolpaywindow://',mptransactionresults=_0xb818('0x8'),mprunscriptonpopup=_0xb818('0x9'),mpcloseallwindows=_0xb818('0xa'),mppinstructioncapture=_0xb818('0xb'),molpayresulturl=_0xb818('0xc'),molpaynbepayurl=_0xb818('0xd'),b4results=_0xb818('0xe'),c6results=_0xb818('0xf'),molpayPaymentDetails,transactionResultCallback,molpayDiv,mainUiFrame,bankUiWindow,molpayTransactionRequestFrame,isClosingMolpay=!0x1,hideFrame=function(_0x1e65e1){_0x1e65e1[_0xb818('0x10')][_0xb818('0x11')]=_0xb818('0x12'),_0x1e65e1[_0xb818('0x10')][_0xb818('0x13')]=_0xb818('0x14'),_0x1e65e1['style'][_0xb818('0x15')]=_0xb818('0x16'),_0x1e65e1[_0xb818('0x10')][_0xb818('0x17')]=_0xb818('0x16');},showFrame=function(_0x28814b){_0x28814b[_0xb818('0x10')][_0xb818('0x11')]=_0xb818('0x18'),_0x28814b[_0xb818('0x10')][_0xb818('0x13')]=_0xb818('0x14'),_0x28814b[_0xb818('0x10')]['width']=_0xb818('0x19'),_0x28814b['style'][_0xb818('0x17')]='100%';},postMolpayResultHandler=function(_0x281f7c){var _0x348891=_0x281f7c;if(_0x348891){var _0x294224=new RegExp(_0xb818('0x1a')),_0x171db2=_0x294224[_0xb818('0x1b')](_0x348891);_0x171db2&&(_0x348891=_0x348891['slice'](0x0,_0x171db2[_0xb818('0x1c')]));var _0x23a63a=function(_0x5d76d1){var _0x15ecde,_0x1fe302,_0x2d0799=_0x5d76d1,_0x3d2a51=new RegExp('<','g'),_0x1160c3=new RegExp('<'),_0x270f4d=new RegExp('>'),_0x7bba17=_0x2d0799[_0xb818('0x1d')](_0x3d2a51);if(_0x2d0799&&_0x7bba17&&_0x1160c3[_0xb818('0x1b')](_0x2d0799)&&_0x270f4d[_0xb818('0x1b')](_0x2d0799))for(var _0x2258a5=_0x7bba17[_0xb818('0x5')]-0x1;_0x2258a5>=0x0;_0x2258a5--)_0x15ecde=_0x1160c3[_0xb818('0x1b')](_0x2d0799)[_0xb818('0x1c')],_0x1fe302=_0x270f4d[_0xb818('0x1b')](_0x2d0799)[_0xb818('0x1c')],_0x2d0799=_0x2d0799['substring'](0x0,_0x15ecde)+''+_0x2d0799['substring'](_0x1fe302+0x1);return _0x2d0799;};_0x348891=_0x23a63a(_0x348891);var _0x4d6407,_0x3d3200;if(_0x4d6407=new RegExp(b4results),_0x4d6407[_0xb818('0x1e')](_0x348891)&&(_0x3d3200=JSON[_0xb818('0x1f')](_0x348891))){var _0x325f54=_0x3d3200[_0xb818('0x20')];_0x325f54&&mainUiFrame[_0xb818('0x21')]['transactionRequestWithTransactionId'](_0x325f54);}}},isBankUiWindowClosedByCloseWindowEvent=!0x1,createBankUiWindow=function(_0x29fe9a){var _0x1fd6b2='data:text/html;base64,'+_0x29fe9a;bankUiWindow=window[_0xb818('0x0')](_0x1fd6b2,_0xb818('0x22'),_0xb818('0x23'));var _0x253268=function(_0x12a1cb){isBankUiWindowClosedByCloseWindowEvent||mainUiFrame[_0xb818('0x21')]['transactionRequest'](),bankUiWindow[_0xb818('0x24')]('exit',_0x253268);};bankUiWindow[_0xb818('0x25')](_0xb818('0x26'),_0x253268);var _0x2b5926=function(_0x56e81f){var _0x729d0d;_0x729d0d=new RegExp(molpaynbepayurl),_0x56e81f&&_0x729d0d['test'](_0x56e81f[_0xb818('0x27')])&&(bankUiWindow[_0xb818('0x28')]({'code':_0xb818('0x29')},function(_0x136c24){}),bankUiWindow[_0xb818('0x28')]({'code':'window.close\x20=\x20function\x20()\x20{\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.location.assign(window.location);\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};'},function(_0x4bac2e){}));};bankUiWindow[_0xb818('0x25')]('loadstop',_0x2b5926);var _0x23246e=function(_0x5ae4a1){var _0x4ff115;if(mainUiFrame[_0xb818('0x21')][_0xb818('0x2a')]({'requestPath':_0x5ae4a1[_0xb818('0x27')]}),_0x4ff115=new RegExp(molpaynbepayurl),_0x5ae4a1&&_0x4ff115[_0xb818('0x1e')](_0x5ae4a1[_0xb818('0x27')]))var _0x40bcf1=0xa,_0x5e4087=0x0,_0x14794c=setInterval(function(){_0x30f31d();},0x3e8),_0x30f31d=function(){_0x5e4087++,_0x5e4087>_0x40bcf1?clearInterval(_0x14794c):bankUiWindow['executeScript']({'code':'document.body.innerHTML'},function(_0x319bbf){var _0x58c9bb=_0x319bbf[0x0],_0x4384ef=new RegExp(b4results);_0x4384ef[_0xb818('0x1e')](_0x58c9bb)&&(postMolpayResultHandler(_0x58c9bb),bankUiWindow['removeEventListener'](_0xb818('0x2b'),_0x23246e),bankUiWindow[_0xb818('0x2c')](),clearInterval(_0x14794c));});};};bankUiWindow[_0xb818('0x25')](_0xb818('0x2b'),_0x23246e);},inAppCallback=function(_0x4ff1a6){function _0x2bf682(){window[_0xb818('0x2d')][_0xb818('0x2e')][_0xb818('0x2f')]({'message':'Image\x20saved\x20success!','duration':0x3e8,'position':_0xb818('0x30')});}function _0x40a3a4(){window[_0xb818('0x2d')][_0xb818('0x2e')]['showWithOptions']({'message':'Image\x20saved\x20fail!','duration':0x3e8,'position':_0xb818('0x30')});}function _0x3cccc2(){var _0x4ff1a6=cordova['plugins']['permissions'];_0x40a3a4();var _0x2fef0e=function(){_0x40a3a4();};_0x4ff1a6[_0xb818('0x31')](_0x4ff1a6[_0xb818('0x32')],function(_0x17e81c){_0x17e81c[_0xb818('0x33')]?_0x3bebe1():_0x2fef0e();},_0x2fef0e);}var _0x4d00e4,_0x3690b2;if(_0x4ff1a6&&_0x4ff1a6[_0xb818('0x34')](mpopenmolpaywindow)>-0x1)_0x3690b2=new RegExp(mpopenmolpaywindow,'g'),_0x4d00e4=_0x4ff1a6[_0xb818('0x35')](_0x3690b2,''),_0x4d00e4&&_0x4d00e4[_0xb818('0x5')]>0x0&&createBankUiWindow(_0x4d00e4);else if(_0x4ff1a6&&_0x4ff1a6['indexOf'](mpcloseallwindows)>-0x1)isBankUiWindowClosedByCloseWindowEvent=!0x0,bankUiWindow[_0xb818('0x2c')]();else if(_0x4ff1a6&&_0x4ff1a6[_0xb818('0x34')](mptransactionresults)>-0x1){if(_0x3690b2=new RegExp(mptransactionresults,'g'),_0x4d00e4=_0x4ff1a6[_0xb818('0x35')](_0x3690b2,''),_0x4d00e4&&_0x4d00e4[_0xb818('0x5')]>0x0){var _0x25bc3c=window[_0xb818('0x36')](_0x4d00e4),_0x5c78e8=JSON['stringify'](JSON[_0xb818('0x1f')](_0x25bc3c));transactionResultCallback(_0x5c78e8),isClosingMolpay&&(molpayDiv[_0xb818('0x37')]='',isClosingMolpay=!0x1),molpayTransactionRequestFrame&&molpayTransactionRequestFrame[_0xb818('0x3')]();}}else if(_0x4ff1a6&&_0x4ff1a6[_0xb818('0x34')](mppinstructioncapture)>-0x1){_0x3690b2=new RegExp(mppinstructioncapture,'g'),_0x4d00e4=_0x4ff1a6[_0xb818('0x35')](_0x3690b2,'');var _0x22a5c9=JSON[_0xb818('0x1f')](atob(_0x4d00e4)),_0x530cfe={'data':_0x22a5c9[_0xb818('0x38')],'prefix':_0x22a5c9[_0xb818('0x39')],'format':'PNG','quality':0x64,'mediaScanner':!0x0};window['imageSaver'][_0xb818('0x3a')](_0x530cfe,function(_0x507bfb){_0x2bf682();},_0x3cccc2);var _0x3bebe1=function(){window['imageSaver'][_0xb818('0x3a')](_0x530cfe,function(_0x5250cb){_0x2bf682();},function(_0x1ca08a){_0x40a3a4();});};}if(_0x4ff1a6&&_0x4ff1a6[_0xb818('0x34')](mprunscriptonpopup)>-0x1&&(_0x3690b2=new RegExp(mprunscriptonpopup,'g'),_0x4d00e4=_0x4ff1a6[_0xb818('0x35')](_0x3690b2,''),_0x4d00e4&&_0x4d00e4['length']>0x0)){var _0x2d1258=window[_0xb818('0x36')](_0x4d00e4);bankUiWindow[_0xb818('0x28')]({'code':_0x2d1258},function(_0x34142b){});}},molpayCredentialsRequestFrame,testMerchantCredentialsCallback,onTestMerchantCredentialsDone=function(_0x4d3d8a,_0x2d4053){testMerchantCredentialsCallback(_0x4d3d8a,_0x2d4053),isClosingMolpay&&(molpayDiv['innerHTML']='',isClosingMolpay=!0x1),molpayCredentialsRequestFrame&&molpayCredentialsRequestFrame[_0xb818('0x3')]();},molpayChannelsRequestFrame,testMerchantChannelsCallback,onTestMerchantChannelsDone=function(_0xee5a6f,_0x2e9b57){testMerchantChannelsCallback&&testMerchantChannelsCallback(_0xee5a6f,_0x2e9b57),isClosingMolpay&&(molpayDiv[_0xb818('0x37')]='',isClosingMolpay=!0x1),molpayChannelsRequestFrame&&molpayChannelsRequestFrame[_0xb818('0x3')]();},exec=require(_0xb818('0x3b'));MOLPay[_0xb818('0x2')][_0xb818('0x3c')]=function(_0x1b877d,_0x302774){isClosingMolpay=!0x1,isBankUiWindowClosedByCloseWindowEvent=!0x1;try{molpayPaymentDetails=JSON[_0xb818('0x1f')](_0x1b877d);}catch(_0x1b5fd2){molpayPaymentDetails=_0x1b877d;}molpayPaymentDetails[_0xb818('0x3d')]=moduleId,molpayPaymentDetails[_0xb818('0x3e')]=wrapperVersion,transactionResultCallback=_0x302774,molpayDiv=document[_0xb818('0x3f')](_0xb818('0x40')),molpayDiv['style']['width']=_0xb818('0x19'),molpayDiv['style'][_0xb818('0x41')]=_0xb818('0x16'),molpayDiv['style'][_0xb818('0x42')]=_0xb818('0x16'),mainUiFrame=document[_0xb818('0x43')](_0xb818('0x44'));var _0x7d1a6e=function(_0x8ab40c){mainUiFrame['contentWindow'][_0xb818('0x45')](JSON['stringify'](molpayPaymentDetails),inAppCallback),mainUiFrame['removeEventListener'](_0xb818('0x46'),_0x7d1a6e);};mainUiFrame['style'][_0xb818('0x42')]='0px',mainUiFrame[_0xb818('0x10')][_0xb818('0x41')]=_0xb818('0x16'),mainUiFrame[_0xb818('0x10')]['width']=_0xb818('0x19'),mainUiFrame[_0xb818('0x10')][_0xb818('0x17')]=_0xb818('0x19'),mainUiFrame['id']=_0xb818('0x47'),mainUiFrame[_0xb818('0x48')]=_0xb818('0x49'),mainUiFrame[_0xb818('0x4a')](_0xb818('0x4b'),molpaySdkUrl),molpayDiv['appendChild'](mainUiFrame),mainUiFrame[_0xb818('0x25')](_0xb818('0x46'),_0x7d1a6e);},MOLPay['prototype'][_0xb818('0x4c')]=function(_0x4c4e8c,_0x2a7fc3){try{molpayPaymentDetails=JSON['parse'](_0x4c4e8c);}catch(_0x1b3ba7){molpayPaymentDetails=_0x4c4e8c;}molpayPaymentDetails[_0xb818('0x3d')]=moduleId,molpayPaymentDetails[_0xb818('0x3e')]=wrapperVersion,transactionResultCallback=_0x2a7fc3,molpayTransactionRequestFrame=document['createElement']('iframe');var _0x4031be=function(_0x2cb048){molpayTransactionRequestFrame[_0xb818('0x21')][_0xb818('0x45')](molpayPaymentDetails,inAppCallback),molpayTransactionRequestFrame[_0xb818('0x24')]('load',_0x4031be);};molpayTransactionRequestFrame['id']='molpayTransactionRequestFrame',molpayTransactionRequestFrame[_0xb818('0x48')]='always',molpayTransactionRequestFrame[_0xb818('0x4a')](_0xb818('0x4b'),molpaySdkUrl),hideFrame(molpayTransactionRequestFrame),document[_0xb818('0x4d')]['appendChild'](molpayTransactionRequestFrame),molpayTransactionRequestFrame[_0xb818('0x25')]('load',_0x4031be);},MOLPay[_0xb818('0x2')][_0xb818('0x4e')]=function(){mainUiFrame[_0xb818('0x21')][_0xb818('0x4f')]();},MOLPay[_0xb818('0x2')][_0xb818('0x50')]=function(_0x555e43,_0x1458c2){_0x1458c2&&(testMerchantCredentialsCallback=_0x1458c2),molpayCredentialsRequestFrame=document[_0xb818('0x43')](_0xb818('0x44'));var _0x4cb98b=function(_0x4a8416){molpayCredentialsRequestFrame[_0xb818('0x21')][_0xb818('0x50')](_0x555e43,onTestMerchantCredentialsDone),molpayCredentialsRequestFrame['removeEventListener'](_0xb818('0x46'),_0x4cb98b);};molpayCredentialsRequestFrame[_0xb818('0x48')]=_0xb818('0x49'),molpayCredentialsRequestFrame[_0xb818('0x4a')](_0xb818('0x4b'),molpaySdkUrl),hideFrame(molpayCredentialsRequestFrame),document[_0xb818('0x4d')][_0xb818('0x51')](molpayCredentialsRequestFrame),molpayCredentialsRequestFrame[_0xb818('0x25')](_0xb818('0x46'),_0x4cb98b);},MOLPay['prototype']['testMerchantChannels']=function(_0x44ad99,_0x56e61c){_0x56e61c&&(testMerchantChannelsCallback=_0x56e61c),molpayChannelsRequestFrame=document[_0xb818('0x43')](_0xb818('0x44'));var _0x28e3b0=function(_0x5b7083){molpayChannelsRequestFrame[_0xb818('0x21')][_0xb818('0x52')](_0x44ad99,onTestMerchantChannelsDone),molpayChannelsRequestFrame[_0xb818('0x24')](_0xb818('0x46'),_0x28e3b0);};molpayChannelsRequestFrame['allowScriptAccess']=_0xb818('0x49'),molpayChannelsRequestFrame[_0xb818('0x4a')](_0xb818('0x4b'),molpaySdkUrl),hideFrame(molpayChannelsRequestFrame),document[_0xb818('0x4d')][_0xb818('0x51')](molpayChannelsRequestFrame),molpayChannelsRequestFrame['addEventListener'](_0xb818('0x46'),_0x28e3b0);};var molpay=new MOLPay();module[_0xb818('0x53')]=molpay; \ No newline at end of file +var _0x818b=['toast','showWithOptions','bottom','requestPermission','WRITE_EXTERNAL_STORAGE','hasPermission','indexOf','replace','atob','innerHTML','base64ImageUrlData','filename','saveBase64Image','cordova/exec','startMolpay','module_id','wrapper_version','getElementById','molpay','padding','border','createElement','iframe','updateSdkData','load','mainUiFrame','allowScriptAccess','always','setAttribute','src','transactionRequest','body','closeMolpay','closemolpay','testMerchantCredentials','appendChild','testMerchantChannels','exports','open','InAppBrowser','prototype','remove','removeChild','length','parentElement','molpay-mobile-xdk-cordova','mptransactionresults://','mprunscriptonpopup://','mpcloseallwindows://','mppinstructioncapture://','MOLPay/result.php','MOLPay/nbepay.php','\x22msgType\x22:\x22B4\x22','\x22msgType\x22:\x22C6\x22','style','visibility','hidden','position','absolute','width','0px','height','visible','100%','=0x0;_0xa1aca4--)this[_0xa1aca4]&&this[_0xa1aca4][_0xb818('0x6')]&&this[_0xa1aca4][_0xb818('0x6')][_0xb818('0x4')](this[_0xa1aca4]);};var isInternalDebugging=!0x1,moduleId=_0xb818('0x7'),wrapperVersion='3',molpaySdkUrl='molpay-mobile-xdk-www/index.html',mpopenmolpaywindow='mpopenmolpaywindow://',mptransactionresults=_0xb818('0x8'),mprunscriptonpopup=_0xb818('0x9'),mpcloseallwindows=_0xb818('0xa'),mppinstructioncapture=_0xb818('0xb'),molpayresulturl=_0xb818('0xc'),molpaynbepayurl=_0xb818('0xd'),b4results=_0xb818('0xe'),c6results=_0xb818('0xf'),molpayPaymentDetails,transactionResultCallback,molpayDiv,mainUiFrame,bankUiWindow,molpayTransactionRequestFrame,isClosingMolpay=!0x1,hideFrame=function(_0x1e65e1){_0x1e65e1[_0xb818('0x10')][_0xb818('0x11')]=_0xb818('0x12'),_0x1e65e1[_0xb818('0x10')][_0xb818('0x13')]=_0xb818('0x14'),_0x1e65e1['style'][_0xb818('0x15')]=_0xb818('0x16'),_0x1e65e1[_0xb818('0x10')][_0xb818('0x17')]=_0xb818('0x16');},showFrame=function(_0x28814b){_0x28814b[_0xb818('0x10')][_0xb818('0x11')]=_0xb818('0x18'),_0x28814b[_0xb818('0x10')][_0xb818('0x13')]=_0xb818('0x14'),_0x28814b[_0xb818('0x10')]['width']=_0xb818('0x19'),_0x28814b['style'][_0xb818('0x17')]='100%';},postMolpayResultHandler=function(_0x281f7c){var _0x348891=_0x281f7c;if(_0x348891){var _0x294224=new RegExp(_0xb818('0x1a')),_0x171db2=_0x294224[_0xb818('0x1b')](_0x348891);_0x171db2&&(_0x348891=_0x348891['slice'](0x0,_0x171db2[_0xb818('0x1c')]));var _0x23a63a=function(_0x5d76d1){var _0x15ecde,_0x1fe302,_0x2d0799=_0x5d76d1,_0x3d2a51=new RegExp('<','g'),_0x1160c3=new RegExp('<'),_0x270f4d=new RegExp('>'),_0x7bba17=_0x2d0799[_0xb818('0x1d')](_0x3d2a51);if(_0x2d0799&&_0x7bba17&&_0x1160c3[_0xb818('0x1b')](_0x2d0799)&&_0x270f4d[_0xb818('0x1b')](_0x2d0799))for(var _0x2258a5=_0x7bba17[_0xb818('0x5')]-0x1;_0x2258a5>=0x0;_0x2258a5--)_0x15ecde=_0x1160c3[_0xb818('0x1b')](_0x2d0799)[_0xb818('0x1c')],_0x1fe302=_0x270f4d[_0xb818('0x1b')](_0x2d0799)[_0xb818('0x1c')],_0x2d0799=_0x2d0799['substring'](0x0,_0x15ecde)+''+_0x2d0799['substring'](_0x1fe302+0x1);return _0x2d0799;};_0x348891=_0x23a63a(_0x348891);var _0x4d6407,_0x3d3200;if(_0x4d6407=new RegExp(b4results),_0x4d6407[_0xb818('0x1e')](_0x348891)&&(_0x3d3200=JSON[_0xb818('0x1f')](_0x348891))){var _0x325f54=_0x3d3200[_0xb818('0x20')];_0x325f54&&mainUiFrame[_0xb818('0x21')]['transactionRequestWithTransactionId'](_0x325f54);}}},isBankUiWindowClosedByCloseWindowEvent=!0x1,createBankUiWindow=function(_0x29fe9a){var _0x1fd6b2='data:text/html;base64,'+_0x29fe9a;bankUiWindow=window[_0xb818('0x0')](_0x1fd6b2,_0xb818('0x22'),_0xb818('0x23'));var _0x253268=function(_0x12a1cb){isBankUiWindowClosedByCloseWindowEvent||mainUiFrame[_0xb818('0x21')]['transactionRequest'](),bankUiWindow[_0xb818('0x24')]('exit',_0x253268);};bankUiWindow[_0xb818('0x25')](_0xb818('0x26'),_0x253268);var _0x2b5926=function(_0x56e81f){var _0x729d0d;_0x729d0d=new RegExp(molpaynbepayurl),_0x56e81f&&_0x729d0d['test'](_0x56e81f[_0xb818('0x27')])&&(bankUiWindow[_0xb818('0x28')]({'code':_0xb818('0x29')},function(_0x136c24){}),bankUiWindow[_0xb818('0x28')]({'code':'window.close\x20=\x20function\x20()\x20{\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.location.assign(window.location);\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};'},function(_0x4bac2e){}));};bankUiWindow[_0xb818('0x25')]('loadstop',_0x2b5926);var _0x23246e=function(_0x5ae4a1){var _0x4ff115;if(mainUiFrame[_0xb818('0x21')][_0xb818('0x2a')]({'requestPath':_0x5ae4a1[_0xb818('0x27')]}),_0x4ff115=new RegExp(molpaynbepayurl),_0x5ae4a1&&_0x4ff115[_0xb818('0x1e')](_0x5ae4a1[_0xb818('0x27')]))var _0x40bcf1=0xa,_0x5e4087=0x0,_0x14794c=setInterval(function(){_0x30f31d();},0x3e8),_0x30f31d=function(){_0x5e4087++,_0x5e4087>_0x40bcf1?clearInterval(_0x14794c):bankUiWindow['executeScript']({'code':'document.body.innerHTML'},function(_0x319bbf){var _0x58c9bb=_0x319bbf[0x0],_0x4384ef=new RegExp(b4results);_0x4384ef[_0xb818('0x1e')](_0x58c9bb)&&(postMolpayResultHandler(_0x58c9bb),bankUiWindow['removeEventListener'](_0xb818('0x2b'),_0x23246e),bankUiWindow[_0xb818('0x2c')](),clearInterval(_0x14794c));});};};bankUiWindow[_0xb818('0x25')](_0xb818('0x2b'),_0x23246e);},inAppCallback=function(_0x4ff1a6){function _0x2bf682(){window[_0xb818('0x2d')][_0xb818('0x2e')][_0xb818('0x2f')]({'message':'Image\x20saved\x20success!','duration':0x3e8,'position':_0xb818('0x30')});}function _0x40a3a4(){window[_0xb818('0x2d')][_0xb818('0x2e')]['showWithOptions']({'message':'Image\x20saved\x20fail!','duration':0x3e8,'position':_0xb818('0x30')});}function _0x3cccc2(){var _0x4ff1a6=cordova['plugins']['permissions'];_0x40a3a4();var _0x2fef0e=function(){_0x40a3a4();};_0x4ff1a6[_0xb818('0x31')](_0x4ff1a6[_0xb818('0x32')],function(_0x17e81c){_0x17e81c[_0xb818('0x33')]?_0x3bebe1():_0x2fef0e();},_0x2fef0e);}var _0x4d00e4,_0x3690b2;if(_0x4ff1a6&&_0x4ff1a6[_0xb818('0x34')](mpopenmolpaywindow)>-0x1)_0x3690b2=new RegExp(mpopenmolpaywindow,'g'),_0x4d00e4=_0x4ff1a6[_0xb818('0x35')](_0x3690b2,''),_0x4d00e4&&_0x4d00e4[_0xb818('0x5')]>0x0&&createBankUiWindow(_0x4d00e4);else if(_0x4ff1a6&&_0x4ff1a6['indexOf'](mpcloseallwindows)>-0x1)isBankUiWindowClosedByCloseWindowEvent=!0x0,bankUiWindow[_0xb818('0x2c')]();else if(_0x4ff1a6&&_0x4ff1a6[_0xb818('0x34')](mptransactionresults)>-0x1){if(_0x3690b2=new RegExp(mptransactionresults,'g'),_0x4d00e4=_0x4ff1a6[_0xb818('0x35')](_0x3690b2,''),_0x4d00e4&&_0x4d00e4[_0xb818('0x5')]>0x0){var _0x25bc3c=window[_0xb818('0x36')](_0x4d00e4),_0x5c78e8=JSON['stringify'](JSON[_0xb818('0x1f')](_0x25bc3c));transactionResultCallback(_0x5c78e8),isClosingMolpay&&(molpayDiv[_0xb818('0x37')]='',isClosingMolpay=!0x1),molpayTransactionRequestFrame&&molpayTransactionRequestFrame[_0xb818('0x3')]();}}else if(_0x4ff1a6&&_0x4ff1a6[_0xb818('0x34')](mppinstructioncapture)>-0x1){_0x3690b2=new RegExp(mppinstructioncapture,'g'),_0x4d00e4=_0x4ff1a6[_0xb818('0x35')](_0x3690b2,'');var _0x22a5c9=JSON[_0xb818('0x1f')](atob(_0x4d00e4)),_0x530cfe={'data':_0x22a5c9[_0xb818('0x38')],'prefix':_0x22a5c9[_0xb818('0x39')],'format':'PNG','quality':0x64,'mediaScanner':!0x0};window['imageSaver'][_0xb818('0x3a')](_0x530cfe,function(_0x507bfb){_0x2bf682();},_0x3cccc2);var _0x3bebe1=function(){window['imageSaver'][_0xb818('0x3a')](_0x530cfe,function(_0x5250cb){_0x2bf682();},function(_0x1ca08a){_0x40a3a4();});};}if(_0x4ff1a6&&_0x4ff1a6[_0xb818('0x34')](mprunscriptonpopup)>-0x1&&(_0x3690b2=new RegExp(mprunscriptonpopup,'g'),_0x4d00e4=_0x4ff1a6[_0xb818('0x35')](_0x3690b2,''),_0x4d00e4&&_0x4d00e4['length']>0x0)){var _0x2d1258=window[_0xb818('0x36')](_0x4d00e4);bankUiWindow[_0xb818('0x28')]({'code':_0x2d1258},function(_0x34142b){});}},molpayCredentialsRequestFrame,testMerchantCredentialsCallback,onTestMerchantCredentialsDone=function(_0x4d3d8a,_0x2d4053){testMerchantCredentialsCallback(_0x4d3d8a,_0x2d4053),isClosingMolpay&&(molpayDiv['innerHTML']='',isClosingMolpay=!0x1),molpayCredentialsRequestFrame&&molpayCredentialsRequestFrame[_0xb818('0x3')]();},molpayChannelsRequestFrame,testMerchantChannelsCallback,onTestMerchantChannelsDone=function(_0xee5a6f,_0x2e9b57){testMerchantChannelsCallback&&testMerchantChannelsCallback(_0xee5a6f,_0x2e9b57),isClosingMolpay&&(molpayDiv[_0xb818('0x37')]='',isClosingMolpay=!0x1),molpayChannelsRequestFrame&&molpayChannelsRequestFrame[_0xb818('0x3')]();},exec=require(_0xb818('0x3b'));MOLPay[_0xb818('0x2')][_0xb818('0x3c')]=function(_0x1b877d,_0x302774){isClosingMolpay=!0x1,isBankUiWindowClosedByCloseWindowEvent=!0x1;try{molpayPaymentDetails=JSON[_0xb818('0x1f')](_0x1b877d);}catch(_0x1b5fd2){molpayPaymentDetails=_0x1b877d;}molpayPaymentDetails[_0xb818('0x3d')]=moduleId,molpayPaymentDetails[_0xb818('0x3e')]=wrapperVersion,transactionResultCallback=_0x302774,molpayDiv=document[_0xb818('0x3f')](_0xb818('0x40')),molpayDiv['style']['width']=_0xb818('0x19'),molpayDiv['style'][_0xb818('0x41')]=_0xb818('0x16'),molpayDiv['style'][_0xb818('0x42')]=_0xb818('0x16'),mainUiFrame=document[_0xb818('0x43')](_0xb818('0x44'));var _0x7d1a6e=function(_0x8ab40c){mainUiFrame['contentWindow'][_0xb818('0x45')](JSON['stringify'](molpayPaymentDetails),inAppCallback),mainUiFrame['removeEventListener'](_0xb818('0x46'),_0x7d1a6e);};mainUiFrame['style'][_0xb818('0x42')]='0px',mainUiFrame[_0xb818('0x10')][_0xb818('0x41')]=_0xb818('0x16'),mainUiFrame[_0xb818('0x10')]['width']=_0xb818('0x19'),mainUiFrame[_0xb818('0x10')][_0xb818('0x17')]=_0xb818('0x19'),mainUiFrame['id']=_0xb818('0x47'),mainUiFrame[_0xb818('0x48')]=_0xb818('0x49'),mainUiFrame[_0xb818('0x4a')](_0xb818('0x4b'),molpaySdkUrl),molpayDiv['appendChild'](mainUiFrame),mainUiFrame[_0xb818('0x25')](_0xb818('0x46'),_0x7d1a6e);},MOLPay['prototype'][_0xb818('0x4c')]=function(_0x4c4e8c,_0x2a7fc3){try{molpayPaymentDetails=JSON['parse'](_0x4c4e8c);}catch(_0x1b3ba7){molpayPaymentDetails=_0x4c4e8c;}molpayPaymentDetails[_0xb818('0x3d')]=moduleId,molpayPaymentDetails[_0xb818('0x3e')]=wrapperVersion,transactionResultCallback=_0x2a7fc3,molpayTransactionRequestFrame=document['createElement']('iframe');var _0x4031be=function(_0x2cb048){molpayTransactionRequestFrame[_0xb818('0x21')][_0xb818('0x45')](molpayPaymentDetails,inAppCallback),molpayTransactionRequestFrame[_0xb818('0x24')]('load',_0x4031be);};molpayTransactionRequestFrame['id']='molpayTransactionRequestFrame',molpayTransactionRequestFrame[_0xb818('0x48')]='always',molpayTransactionRequestFrame[_0xb818('0x4a')](_0xb818('0x4b'),molpaySdkUrl),hideFrame(molpayTransactionRequestFrame),document[_0xb818('0x4d')]['appendChild'](molpayTransactionRequestFrame),molpayTransactionRequestFrame[_0xb818('0x25')]('load',_0x4031be);},MOLPay[_0xb818('0x2')][_0xb818('0x4e')]=function(){mainUiFrame[_0xb818('0x21')][_0xb818('0x4f')]();},MOLPay[_0xb818('0x2')][_0xb818('0x50')]=function(_0x555e43,_0x1458c2){_0x1458c2&&(testMerchantCredentialsCallback=_0x1458c2),molpayCredentialsRequestFrame=document[_0xb818('0x43')](_0xb818('0x44'));var _0x4cb98b=function(_0x4a8416){molpayCredentialsRequestFrame[_0xb818('0x21')][_0xb818('0x50')](_0x555e43,onTestMerchantCredentialsDone),molpayCredentialsRequestFrame['removeEventListener'](_0xb818('0x46'),_0x4cb98b);};molpayCredentialsRequestFrame[_0xb818('0x48')]=_0xb818('0x49'),molpayCredentialsRequestFrame[_0xb818('0x4a')](_0xb818('0x4b'),molpaySdkUrl),hideFrame(molpayCredentialsRequestFrame),document[_0xb818('0x4d')][_0xb818('0x51')](molpayCredentialsRequestFrame),molpayCredentialsRequestFrame[_0xb818('0x25')](_0xb818('0x46'),_0x4cb98b);},MOLPay['prototype']['testMerchantChannels']=function(_0x44ad99,_0x56e61c){_0x56e61c&&(testMerchantChannelsCallback=_0x56e61c),molpayChannelsRequestFrame=document[_0xb818('0x43')](_0xb818('0x44'));var _0x28e3b0=function(_0x5b7083){molpayChannelsRequestFrame[_0xb818('0x21')][_0xb818('0x52')](_0x44ad99,onTestMerchantChannelsDone),molpayChannelsRequestFrame[_0xb818('0x24')](_0xb818('0x46'),_0x28e3b0);};molpayChannelsRequestFrame['allowScriptAccess']=_0xb818('0x49'),molpayChannelsRequestFrame[_0xb818('0x4a')](_0xb818('0x4b'),molpaySdkUrl),hideFrame(molpayChannelsRequestFrame),document[_0xb818('0x4d')][_0xb818('0x51')](molpayChannelsRequestFrame),molpayChannelsRequestFrame['addEventListener'](_0xb818('0x46'),_0x28e3b0);};var molpay=new MOLPay();module[_0xb818('0x53')]=molpay; \ No newline at end of file diff --git a/package.json b/package.json index c21533c..3f869da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "molpay-mobile-xdk-cordova", - "version": "3.18.2", + "version": "3.18.3", "description": "MOLPay official in-app payment module for Cordova", "cordova": { "id": "molpay-mobile-xdk-cordova", diff --git a/plugin.xml b/plugin.xml index ae37c6a..644e931 100644 --- a/plugin.xml +++ b/plugin.xml @@ -27,5 +27,8 @@ Payment images + + Payment images +