PeterHdd / cordova-plugin-crypto-file

Encrypts source files, works with cordova-plugin-ionic-webview
Apache License 2.0
30 stars 28 forks source link

BUG: problem with downloading data from url #10

Open buffy007 opened 5 years ago

buffy007 commented 5 years ago

I'm not sure, what is wrong, but I found this unexpected behaviour. I have simple app which downloads json from url with $.getJSON function in javascript and shows data on screen. Simple and easy. Everything is fine on cordova 7. But I updated to cordova 9 (android 8.1.0) and same js script is not working. I tried many ways to fix, but if I uninstall cordova-plugin-crypto-file everything is OK again. I need to update android to api-28 at least, but with latest version of cordova and android SDK I can't download data from url if I'm using cordova-plugin-crypto-file. How can I fix it?

What I tried

Anybody with same problem? What could be wrong?

` cordova plugin cordova-plugin-crypto-file 1.2.1 "Crypt File" cordova-plugin-whitelist 1.3.4 "Whitelist"

cordova platform Installed platforms: android 8.1.0

cordova --version 9.0.0 (cordova-lib@9.0.1) `

PeterHdd commented 5 years ago

Try and use the latest version of cordova-plugin-crypto-file. The latest version is 1.4.0

buffy007 commented 5 years ago

I tried install it cordova plugin add cordova-plugin-crypto-file@latest or cordova plugin add cordova-plugin-crypto-file@1.4.0 but still see version 1.2.1

irhosseinz commented 4 years ago

I have this problem too. var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { }else if(xhttp.readyState == 4){ //it goes here with xhttp.status=0 } }; xhttp.open("GET",url, true); xhttp.send(); using 1.4.0. and trying to load a data json url and I get nothing in return, if I remove the plugin it works fine

buffy007 commented 4 years ago

Finally I fixed this issue. I had to use old cordova-plugin-crypt-file plugin. I repaired after_prepare.js and it's working for Android 9 and also for last iOS. I spent so much time with fixing this crypto plugin, but without success.

IllusionVK commented 4 years ago

Hey @buffy007 are you able to add your changes as a pull request or perhaps link to the repo changes you made ? it would be a great help for us all and it would help to make sure that people keep on using cordova-plugin-crypt-file, which is good for all of us who uses it so that it doesn't die.. 👍