cordova-plugin-file
cordova-plugin-file copied to clipboard
(android) Use decoded path when querying file list in directory via assetManager
trafficstars
Platforms affected
Android
Motivation and Context
The problem is that subfiles and folders cannot be listed via the assetManager.list function
if the folder name has special characters like @havesource.
# Folder Tree
www/plugins/@havesource/
ㄴ cordova-plugin-push
ㄴ www
ㄴpush.js

Description
The AssetManager.list function does not automatically decode the passed paths that are encoded. So if the folder name has special characters (such as @), it can't listing subfolders and files.
Testing
We need to pass the decoded path to the assetManager.list function. Then the assetManager.list function returns a list of subfolders and files successfully.

Checklist
- [ ] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [x] Commit is prefixed with
(platform)if this change only applies to one platform (e.g.(android)) - [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
- [x] I've updated the documentation if necessary