You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/01/30 22:17:58 UTC

[GitHub] [cordova-plugin-file] breautek commented on issue #510: Android deletes folders with images after Jan, 2022 security update

breautek commented on issue #510:
URL: https://github.com/apache/cordova-plugin-file/issues/510#issuecomment-1025244967


   `cordova.file.cacheDirectory` is the only directory of the directories you mentioned that the Android OS reserves the right to free files at any time.
   
   `cordova.file.externalDataDirectory` as of API 29 (although reversible with a flag) all external directories operate differently and applications don't have free access. As of API 30, the aforementioned flag is forcefully disabled, so you're forced to use the newer scoped storage system. Personally I'd avoid all `cordova.file.external*` directories. Natively, their paths start with `/storage/emulated/` or `/storage/sdcard` (depends whether the device is using a physical SD card).
   
   `cordova.file.applicationStorageDirectory` / `cordova.file.dataDirectory` shouldn't have their files removed unless it was an explicit action from the user (e.g. "Clear Data" button in App Info screen) or the app does it programmatically. Generally I use `cordova.file.dataDirectory` for files myself, but I don't work with image files.
   
   I don't think this works on release variants, but if you can reproduce on a debug variant of your app, I'd be curious if the files are shown under `adb shell`. Alternatively you can use Android Studio device file explorer as well.
   
   Refer to the [Device Path](https://github.com/apache/cordova-plugin-file#android-file-system-layout) for general file system locations.
   
   E.g. the below should show you your `cordova.file.dataDirectory`
   
   ```
   adb shell
   run-as <your app bundle id>
   cd /data/data/<app.id>/files
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org