diff --git a/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java b/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java index ed7a8dc..d624b6a 100644 --- a/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java +++ b/android/src/main/java/com/rnziparchive/RNZipArchiveModule.java @@ -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); @@ -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 { diff --git a/index.js b/index.js index 694439b..970eda3 100644 --- a/index.js +++ b/index.js @@ -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) }