Skip to content

Commit

Permalink
Change filter designation to attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyaji committed Jan 8, 2017
1 parent 9a3f9a6 commit 941ae85
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ You can specify the encryption subjects by editing `plugin.xml`.
```
<cryptfiles>
<include>
<file>\.(htm|html|js|css)$</file>
<file regex="\.(htm|html|js|css)$" />
</include>
<exclude>
<file>exclude_file\.js$</file>
<file regex="exclude_file\.js$" />
</exclude>
</cryptfiles>
```
Expand Down
10 changes: 5 additions & 5 deletions hooks/after_prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function(context) {
var key = crypto.randomBytes(24).toString('base64');
var iv = crypto.randomBytes(12).toString('base64');

console.log("key=" + key + ", iv=" + iv)
console.log('key=' + key + ', iv=' + iv)

var targetFiles = loadCryptFileTargets();

Expand All @@ -35,7 +35,7 @@ module.exports = function(context) {
}).forEach(function(file) {
var content = fs.readFileSync(file, 'utf-8');
fs.writeFileSync(file, encryptData(content, key, iv), 'utf-8');
console.log("encrypt: " + file);
console.log('encrypt: ' + file);
});

if (platform == 'ios') {
Expand Down Expand Up @@ -94,12 +94,12 @@ module.exports = function(context) {
if (cryptfiles.length > 0) {
cryptfiles[0]._children.forEach(function(elm) {
elm._children.filter(function(celm) {
return celm.tag == 'file';
return celm.tag == 'file' && celm.attrib.regex && celm.attrib.regex.trim().length > 0;
}).forEach(function(celm) {
if (elm.tag == 'include') {
include.push(celm.text);
include.push(celm.attrib.regex.trim());
} else if (elm.tag == 'exclude') {
exclude.push(celm.text);
exclude.push(celm.attrib.regex.trim());
}
});
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-crypt-file",
"version": "1.3.1",
"version": "1.3.2",
"description": "This plugin to encrypt/decrypt the source files.",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-plugin-crypt-file"
version="1.3.1">
version="1.3.2">

<name>CordovaCrypt</name>
<description>Plugin Description</description>
Expand Down Expand Up @@ -35,7 +35,7 @@

<cryptfiles>
<include>
<file>\.(htm|html|js|css)$</file>
<file regex="\.(htm|html|js|css)$" />
</include>
<exclude>
</exclude>
Expand Down

0 comments on commit 941ae85

Please sign in to comment.