Skip to content

Commit

Permalink
fix zip on android
Browse files Browse the repository at this point in the history
  • Loading branch information
plrthink committed Aug 17, 2019
1 parent 98ff3a9 commit 9126795
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void zipWithPassword(String fileOrDirectory, String destDirectory, String
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);

String encParts[] = _encryptionMethod.split("-");
String encParts[] = encryptionMethod.split("-");

if (password != null && !password.isEmpty()) {
parameters.setEncryptFiles(true);
Expand All @@ -340,7 +340,7 @@ public void zipWithPassword(String fileOrDirectory, String destDirectory, String
} else {
parameters.setAesKeyStrength(Zip4jConstants.ENC_METHOD_STANDARD);
}
} else if (_encryptionMethod.equals("STANDARD")) {
} else if (encryptionMethod.equals("STANDARD")) {
parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD);
Log.d(TAG, "Standard Encryption");
} else {
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const unzipWithPassword = (source, target, password) => {
return RNZipArchive.unzipWithPassword(source, target, password)
}

export const zipWithPassword = (source, target, password, encryptionMethod) => {
export const zipWithPassword = (source, target, password, encryptionMethod = '') => {
return RNZipArchive.zipWithPassword(source, target, password, encryptionMethod)
}

Expand Down

0 comments on commit 9126795

Please sign in to comment.