-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Describe the bug
Following the README, I've added the following to plugin.xml so I can support json files being encrypted.
<cryptfiles>
<include>
<file regex="\.(htm|html|js|css|json)$" />
</include>
<exclude>
</exclude>
</cryptfiles>During build-time I see the files here are encrypted, but at run-time they are not decrypted. The reason is the DecryptResource.java class is not getting updated with the file regex, and it still has the default list:
private static final String[] CRYPT_FILES = {
".htm",
".html",
".js",
".css",
};I see code in after_prepare.js that intends to change the class, but it is targeting INCLUDE_FILES and EXCLUDE_FILES properties in the Java source, rather than CRYPT_FILES which is in the source here:
| private static final String[] CRYPT_FILES = { |
My workaround is to manually edit the Java class to add the extension.
To Reproduce
Steps to reproduce the behavior:
- add a custom extension into
plugin.xmlas above - compile an app that requires a file of that type
Expected behavior
The app should decrypt the read when it is called.
Additional information
I notice that the original plugin cordova-plugin-crypt-file does have INCLUDE_FILES and EXCLUDE_FILES, so it's possibly just a back-porting issue: