cordova-android icon indicating copy to clipboard operation
cordova-android copied to clipboard

AndroidInsecureFileModeEnabled prefrence not working

Open pawan-logiciel opened this issue 3 years ago • 8 comments

Bug Report

Problem

After Cordova 10 release Cordova added WebViewAssetLoader support which can cause data associated with the file:// scheme, such as cookies, local storage, local cache, and web-based databases

But if we set AndroidInsecureFileModeEnabled to true according to docs(https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html) it will work like earlier which is not working for me

Due to this I am facing cookies issue

What is expected to happen?

After setting AndroidInsecureFileModeEnabled preference to true in config.xml it should work like old one

Information

Command or Code

<preference name="AndroidInsecureFileModeEnabled" value="true" />

Environment, Platform, Device

Version information

[email protected]

Checklist

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

pawan-logiciel avatar Aug 05 '21 12:08 pawan-logiciel

Same issue, How to fixed this?

secretmoo35 avatar Aug 09 '21 10:08 secretmoo35

This ticket does not give enough Information.

At best, I can only recommend upgrading to the latest [email protected] and try again.

cordova platform rm android
cordova platform add android@latest

If you still have the issue after upgrading, try and provide more Information.

For example, provide the information that comes from the network & application tab of the DevTools and make sure its from both the working and non-working app. Both should show that the index.html is loading from file:///android_asset/www/index.html... Application tab should also show that it is reading from file:// for the cookies, etc. If you see it checking file:// but there are no cookies, it probably means Android wiped out the information for more space.

Make sure to also test with 10.1.0 as it might have fixed that area.

erisu avatar Aug 17 '21 05:08 erisu

This ticket does not give enough Information.

At best, I can only recommend upgrading to the latest [email protected] and try again.

cordova platform rm android
cordova platform add android@latest

If you still have the issue after upgrading, try and provide more Information.

For example, provide the information that comes from the network & application tab of the DevTools and make sure its from both the working and non-working app. Both should show that the index.html is loading from file:///android_asset/www/index.html... Application tab should also show that it is reading from file:// for the cookies, etc. If you see it checking file:// but there are no cookies, it probably means Android wiped out the information for more space.

Make sure to also test with 10.1.0 as it might have fixed that area.

Thanks. [email protected] It's works fine for me.

secretmoo35 avatar Aug 18 '21 04:08 secretmoo35

@pawan-logiciel At your earliest convenience, If you could confirm that updating to [email protected] solves your issue for us so we can determine if this issue can be closed or not.

Cheers, Norman

breautek avatar Aug 18 '21 12:08 breautek

@breautek @erisu It's still not working for me.

pawan-logiciel avatar Sep 09 '21 10:09 pawan-logiciel

I've just tried it out and it seems to be working as expected (for me).

HarelM avatar Sep 28 '21 19:09 HarelM

@breautek FYI - I am facing this issue only in android 11 for other versions it's working fine and the issue is not with AndroidInsecureFileModeEnabled it's and cookie issue in my app HTTPS URL (AWS scdn URL) not working it gives 403

pawan-logiciel avatar Oct 19 '21 12:10 pawan-logiciel

Is it possible that the server is setting a restrictive SameSite policy?

breautek avatar May 18 '22 04:05 breautek

Closing as can't reproduce since the setting is working fine for everybody except from the reporter and by the last message the setting seems to be working, but there are cookie problems, which seems related to some server configuration problem, but there was no response to the last question.

Note that the setting, as the name says, is insecure, because google marked it as insecure and might eventually break in future Android versions, so we don't recommend using it and if things stop working there we won't fix them (mostly because we probably can't)

jcesarmobile avatar Dec 03 '23 00:12 jcesarmobile